<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<style>
  .red{
    color: red;
  }
</style>
<body>
<div id="app">
  <ul>
    <li v-for="(item,index) in movies" @click='choose(index,$event)' :class="{red:currentIndex===index}">{{item}}</li>
  </ul>
</div>
<script src="../vue.js"></script>
<script>
  const app = new Vue({
    el: '#app',
    data: {
      currentIndex:0,
      movies: ['海王','海尔兄弟','哈哈']
    },
    methods:{
      choose(index,event){
        this.currentIndex = index
      }
    }
  })
</script>
</body>
</html>
